﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace com.codeplex.eatoutadvocate.Engine
{
    public class EatOut
    {
        private int time;                   //Only hour (hh) to calculate offset
        private Mood mood;
        private int moodLevel;              //E.g. How happy are you? 1-3
        private Weather weather;
        private Temperature temperature;
        private string restaurant;
        private float score;                //Computed recommendation score %

        private EatOut(Builder builder)
        {
            time = builder.time;
            mood = builder.mood;
            moodLevel = builder.moodLevel;
            weather = builder.weather;
            temperature = builder.temperature;
            restaurant = builder.restaurant;
        }
        #region public properties
      
        public int Time
        {
            get
            {
                return time;
            }
            set
            {
                time = value;
            }
        }

        public Mood Mood
        {
            get
            {
                return mood;
            }
            set
            {
                mood = value;
            }
        }

        public int MoodLevel
        {
            get
            {
                return moodLevel;
            }
            set
            {
                moodLevel = value;
            }
        }

        public Weather Weather
        {
            get
            {
                return weather;
            }
            set
            {
                weather = value;
            }
        }

        public Temperature Temperature
        {
            get
            {
                return temperature;
            }
            set
            {
                temperature = value;
            }
        }

        public string Restaurant
        {
            get
            {
                return restaurant;
            }
            set
            {
                restaurant = value;
            }
        }

        public float Score
        {
            get
            {
                return score;
            }
            set
            {
                score = value;
            }
        }

        #endregion

        public class Builder
        {
            public int time;                   
            public Mood mood;
            public int moodLevel;              
            public Weather weather;
            public Temperature temperature;
            public string restaurant;
            public float score;   
            
            public Builder(){ }


            public Builder Time(int time) { this.time = time; return this; }
            public Builder Mood(Mood mood) { this.mood = mood; return this; }
            public Builder MoodLevel(int moodLevel) { this.moodLevel = moodLevel; return this; }
            public Builder Weather(Weather weather) { this.weather = weather; return this; }
            public Builder Temperature(Temperature temperature) { this.temperature = temperature; return this; }
            public Builder Restaurant(string restaurant) { this.restaurant = restaurant; return this;  }

            public EatOut Build() { return new EatOut(this); }
        }

        
    }

    #region enums
    
    public enum Mood
    {
        Happy = 1,
        Sad = 2,
        Neutral = 3,
        Drunk = 4
    }

    public enum Weather
    {
        Pleasant = 1,    // Clear, partly/mostly Cloudy, Overcast, Scattered clouds,
        Adverse = 2    // Everything else
    }

    public enum Temperature
    {
        Cold = 1,   //Less than 40 F
        Mild = 2,   //40 - 65 F
        Warm = 3,   //65 - 85 F
        Hot = 4     //Greater than 85 F
    }

    #endregion
}
